= form_for @user do |f|
  - if @user.errors.any?
    #error_explanation
      %h2= "#{pluralize(@user.errors.count, "error")} prohibited this user from being saved:"
      %ul
        - @user.errors.full_messages.each do |msg|
          %li= msg

  .field
    = f.label :username, "ID"
    = f.text_field :username
  .field
    = f.label :display_name, "姓名"
    = f.text_field :display_name
  .field
    = f.label :phone, "电话"
    = f.telephone_field :phone
  .field
    = f.label :email, "邮箱"
    = f.email_field :email  
  .field
    = f.label :password, "密码"
    = f.password_field :password, :value => @user.password
  .field
    = f.label :is_regenerate_token, "是否重新生成Token"
    .radio_horizontal_group
      .radio_item
        = radio_button_tag :is_regenerate_token, "yes", true 
        =label_tag "is_regenerate_token_yes", "是"
      .radio_item
        = radio_button_tag :is_regenerate_token, "no"
        = label_tag "is_regenerate_token_no", "否"
  .actions
    = f.submit 'Save'
